<!DOCTYPE html>
<html lang="zh-CN">

<head>
    <!-- Meta, title, CSS, favicons, etc. -->
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0,user-scalable=no">
    <meta http-equiv="Pragma" content="no-cache" />
    <meta http-equiv="Cache-Control" content="no-cache" />
    <meta name="description" content="长沙市妇幼医院">
    <script src="./js/jquery.min.js"></script>
    <script src="./js/area/LAreaData2.js"></script>
    <script src="./js/order/coupon_op.js"></script>
    <title>长沙市妇幼医院</title>

    <!-- Documentation extras -->
    <style>
        h1,
        .h1,
        h2,
        .h2,
        h4,
        .h4,
        h4,
        .h4,
        .lead {
            font-family: "Microsoft YaHei UI", "Microsoft YaHei", "ff-tisa-web-pro-1", "ff-tisa-web-pro-2", "Lucida Grande", "Helvetica Neue", Helvetica, Arial, "Hiragino Sans GB", "Hiragino Sans GB W3", "WenQuanYi Micro Hei", sans-serif;
        }

        .black_overlay {
            display: none;
            position: fixed;
            top: 0%;
            left: 0%;
            width: 100%;
            height: 100%;
            background-color:#000;
            z-index:1000;
            -moz-opacity: 0.8;
            opacity:.70;
            filter: alpha(opacity=70);
        }

        .tips-icon {
            padding-left: 5px;
        }

        .tips {
            display: none;
            position: fixed;
            width: 70%;
            margin-left: 15%;
            top: 100px;
            background-color: #fff;
            z-index: 1001;
            border: 1px solid #f3f3f3;
            border-radius: 10px;
        }

        .tips-msg {
            padding: 15px;
            color: #333;
            text-align: justify;
        }

        .tips-line {
            height: 1px;
            border-top: 1px solid #f3f3f3;
        }

        .tips-close {
            color: blue;
            text-align: center;
        }
    </style>
    <style>
        html,
        body {
            padding-top: 0;
            background-color: #ffffff;
            width: 100%;
            margin: 0;
            padding: 0;
        }

        #ban_bt {
            /*position:fixed;*/
            background-color: #07b8dd;
            bottom: 10px;
            z-index: 9999;
            text-align: center;
            margin-top: 25px;
            margin-left: auto;
            margin-right: auto;
            margin-bottom: 10px;
            left: 0;
            right: 0;
            height: 40px;
            width: 90%;
            border: 1px solid #dcdcdc;
            border-radius: 5px;
        }

        #ban_bt button {
            color: #fff;
            height: 40px;
            font-size: 20px;
            width: 100%;
            border: 0;
            background: 0;
        }

        #ban_bt.tian {
            background: #f883ad;
        }

        #ban_bt.tian button {
            color: #fff;
        }

        .text-cont {
            margin: 20px 6px 6px 6px;
            height: 75%;
            border: 1px solid #dcdcdc;
            border-radius: 5px;
            background-color: #fff;
            overflow: scroll;
        }

        .text-detail {
            font-size: 14px;
            text-align: justify;
            margin-left: 15px;
            margin-right: 15px;
            line-height: 20px;
            margin-top: 15px;
            color: #333333;
        }

        .text-title {
            font-size: 16px;
            text-align: center;
            margin-left: 20px;
            margin-right: 20px;
            margin-bottom: 30px;
            margin-top: 28px;
            color: #333333;
        }

        .text-qr {
            font-size: 16px;
            margin-left: 6px;
            margin-right: 6px;
            margin-top: 10px;
            color: #666;
        }

        .text-qr p {
            margin: 0;
            line-height: 28px;
        }

        .text-qr img {
            width: 22px;
            margin-right: 10px;
            vertical-align: middle;
        }

        .checkbox {
            width: 25px;
            height: 25px;
            padding: 0 5px 0 0;
            display: block;
            background-color: #fff;
        }

        .text-checkinfo {
            height: 25px;
            margin-top: 5px;
        }

        input[type=checkbox],
        input[type=radio] {
            appearance: none;
            width: 20px;
            height: 20px;
            margin-right: 10px;
            cursor: pointer;
            vertical-align: bottom;
            background: #fff;
            border: 1px solid #dcdcdc;
            -webkit-border-radius: 1px;
            -moz-border-radius: 1px;
            border-radius: 1px;
            -webkit-box-sizing: border-box;
            -moz-box-sizing: border-box;
            box-sizing: border-box;
            position: relative;
        }

        input[type=checkbox]:checked,
        input[type=radio]:checked {
            background: #000;
        }

        .round {
            border: 0px solid #ffffff;
            -webkit-border-radius: 5px;
            color: #fff;
        }

        .prompt_message_block {
            background-color: #04aed1;
            height: 80px;
            width: 100%;
        }

        .prompt_message_icon {
            float: left;
            padding-top: 11px;
            padding-left: 16px;
            width: 11px;
            height: 11px;
        }

        .prompt_message_l {
            color: #ffffff;
            font-size: 15px;
            padding-left: 16px;
            padding-top: 21px;
            margin: 0;
        }

        .prompt_message_s {
            float: left;
            color: #ffffff;
            font-size: 11px;
            padding-left: 5px;
            padding-top: 11px;
            margin: 0;
        }

        .sheet_top {
            height: 45px;
        }

        .start_block {
            height: 17px;
            width: 5px;
            color: #07b8dd;
            margin-top: 15px;
            margin-bottom: 13px;
            background-color: #07b8dd;
            float: left;
        }

        .sheet_top_text {
            color: #333333;
            font-size: 15px;
            float: left;
            padding-left: 15px;
            padding-top: 13px;
        }

        .sheet_top_edit {
            float: right;
            padding-right: 20px;
            padding-top: 13px;
            color: #07b8dd;
            width: 50px;
            height: 15px;
        }

        .sheet_necessary_content {
            background-color: #f5f5f5;
            margin-left: 17px;
            margin-right: 17px;
        }

        .sheet_optional_content {
            background-color: #f5f5f5;
            margin-left: 17px;
            margin-right: 17px;
            margin-top: 8px;
            margin-bottom: 8px;
        }

        .sheet_text {
            padding-left: 15px;
            padding-top: 7px;
            padding-bottom: 7px;
            color: #333333;
            font-size: 14px;
            margin: 0 auto;
            line-height: 20px;
            height: 20px;
        }

        .sheet_label {
            text-align: justify;
            word-spacing: 23.5688px;
            float: left;
        }

        .sheet_value {
            margin-left: 15px;
            float: left;
        }

        .sheet_note {
            padding-top: 5px;
            padding-left: 15px;
        }

        .sheet_note_point {
            color: #d3d3d3;
        }

        .sheet_note_content {
            font-size: 12px;
            color: #bababa;
        }

        .confirm_button {
            background-color: #07b8dd;
            color: #ffffff;
            font-size: 20px;
            margin-left: 15px;
            margin-right: 15px;
            margin-top: 25px;
            height: 40px;
            margin-bottom: 10px;
            text-align: center;
            line-height: 40px;
        }

        .mark {
            border-bottom: 1px solid #ffa800;
            color: #ffa800;
        }
        
    </style>
    
    <script>
        var hospitalData = '';
        var errorMsg = '';
        var couponNum=''
        var personInfo = {id:'',barcodeImg:'',frontimage:'',name:''}
        $(document).ready(function(){
            initUrlInfo()
            doQuery(couponNum);
        })
        $(function () {
            if (2 === 1) {
                $("#prompt_message_block").css("background-color", "#ffa800");
            }
            if (errorMsg) {
                setTimeout(closeErrorMsg, 3000);
            }
            analysisIvfRemark();
        });
        function doQuery(couponNum){
            var url = "/csfy/user/getPresonInfo.do";
            if(couponNum){
                url = url + '?' + `couponNum=${couponNum}&withImgCode=1`
            }else{
                return
            }
            $.ajax({
                type:"post",
                url:url,
                data:{},
                dataType:"json",
                success:function (data) {
                    if(data.code == 200){
                        var info = data.data
                        personInfo.id=info.id;
                        personInfo.name=info.name;
                        personInfo.frontimage = info.frontimage
                        $('#idCard').text(personInfo.id)
                        var idImg = 'data:image/jpg;base64,'+personInfo.frontimage
                        $('#frontimage').attr('src',idImg)
                        $('#name').text(personInfo.name)
                        var rows = info.couponInfos;
                        var cusStr = '';
                        if(rows) {
                            for(var key in rows){
                                var obj = rows[key];
                                obj.idCard=personInfo.id;
                                if(obj.couponNum==couponNum){
                                    personInfo.barcodeImg=obj.barcodeImg
                                }
                                if(obj.type===2) continue;
                                var couponStatus = obj.status==0?0:1
                                var statusTip = obj.status==0?'未使用':'已使用'
                                var str = `<li style="height:65px;" id="coupon-${key}" data-input="${obj.couponNum}" data-value="${obj.couponName}" class="sel-info coupon_sel_${couponStatus}" onclick="selCoupon(this);"><div class="coupon_sel_info"><div class="coupon_sel_name">${obj.couponName}</div><div class="coupon_sel_tip">限身份证号码为${obj.idCard}使用</div></div><div class="coupon_sel_iconbox"><img class="coupon_sel_icon" src="./images/order/coupon.png" /><div class="coupon_sel_status_${couponStatus}" >${statusTip}</div></div></li><li><div class="input-line"></div></li>`
                                cusStr += str;
                            }


                        } else {
                            var str = '<li style="text-align:center;color: #00afee;" id="coupon-'+ 0 +'" data-input="'+''+'" data-value="'+''+'" class="sel-info" onclick="selCoupon(this);">'+'您还没有免费券,您可以在公众号点击菜单我的服务-->领取免费券'+'</li><div class="input-line"></div>';

                        }
                    }else {
                        alert(data.msg);
                    }
                }
            });
        }
        function initUrlInfo(){
            var url = location.search;
            url = decodeURI(url);
            url = decodeURI(url);
            var Request = new Object();
            if(url.indexOf("?")!=-1){
                var str = url.substr(1);//去掉?号
                strs = str.split("&");
                for(var i=0;i<strs.length;i++){
                    var key = strs[i].split("=")[0];
                    var value = unescape(strs[i].split("=")[1]);
                    Request[key]=value;
                    var keyId = '#' + key;
                    $(keyId).text(value);
                }
            }
            couponNum = Request['couponNum']||'';
            $('#couponNum').text(couponNum.substring(0,10))
            if(couponNum){
                hasCoupon(true)
            }else{
                hasCoupon(false)
            }
        }
        function hasCoupon(){

        }
        function closeErrorMsg(){
            
        }

        function checkForm() {
            $("#formBtn").attr('disabled', "true");
            $("#ban_bt").css('background', '0');
            $("#formBtn").css('color', '#ACACAC');
            return true;
        }
    </script>

    <script>
        function analysisIvfRemark(remark) {
            var ivfRemark = remark + "";
            if (ivfRemark === '') return;
            var ivfRemarkText = "";
            if (ivfRemark === '0') {
                ivfRemarkText = "着床一胎";
            }
            if (ivfRemark === '10') {
                ivfRemarkText = "着床两胎,两胎均正常";
            }
            if (ivfRemark === '1211') {
                ivfRemarkText = "着床两胎,一胎停育或减胎,8周内丢失胚胎,距停育后继续妊娠8周及以上"
            }
            $("#ivfRemarkText").text(ivfRemarkText);
        }
    </script>
</head>

<body>
    <div id="content">
        <div id="prompt_message_block" class="prompt_message_block" style="height:100px;">
            <p class="prompt_message_l"></p>
            <div style="margin:0 auto; overflow:auto;">
                <img style="display:block;margin-left:auto;margin-right:auto;width:50px;height:50px;" src="./images/order/checked.png">
                <div style="text-align:center;">验证成功, 免费券编号:<span id="couponNum"></span></div>
            </div>
        </div>
        <div id="sheet">
                <div class="sheet_top">
                    <div class="start_block"></div>
                    <div class="sheet_top_text">
                        <b>证件信息</b>
                    </div>
                </div>
                <div class="sheet_necessary_content round">
                    <div>
                        <img id='frontimage' style="display:block; width:100%; height:auto;" src="./images/order/demo_idcard.jpg" />
                    </div>
                </div>
        </div>
        <div id="sheet1">
            <div class="sheet_top">
                <div class="start_block"></div>
                <div class="sheet_top_text">
                    <b>送检单状态</b>
                </div>
            </div>
            <div class="sheet_necessary_content round">
                <div class="sheet_text">
                    <div id="status_label" class="sheet_label">待确认采样</div>
                    <div id="needOtherReport" class="sheet_value"></div>
                </div>
            </div>
        </div>
        <div id="sheet2">
            <div class="sheet_top">
                <div class="start_block"></div>
                <div class="sheet_top_text">
                    <b>就诊人送检单</b>
                </div>
            </div>
            <div class="sheet_necessary_content round">
                <div class="sheet_text" style="padding-top: 14px">
                    <div class="sheet_label">姓 名:</div>
                    <div id="name" class="sheet_value mark">测试用户</div>
                </div>
                <div class="sheet_text">
                    <div class="sheet_label" style="word-spacing: 2.5263px">手 机 号:</div>
                    <div class="sheet_value">13410339963</div>
                </div>
                <div class="sheet_text">
                    <div class="sheet_label" style="word-spacing: 2.5263px">紧急联系电话:</div>
                    <div class="sheet_value">13410339963</div>
                </div>
                <div class="sheet_text">
                    <div class="sheet_label">证件号码:</div>
                    <div id="idCard" class="sheet_value">41048219890327503X</div>
                </div>
                <div class="sheet_text">
                    <div class="sheet_label">年龄:</div>
                    <div class="sheet_value">28</div>
                </div>
                <div class="sheet_text">
                    <div class="sheet_label">末次月经:</div>
                    <div class="sheet_value">2017-08-12</div>
                </div>
                <div class="sheet_text">
                    <div class="sheet_label">孕 周:</div>
                    <div class="sheet_value mark">13周+1</div>
                </div>
                <div class="sheet_text">
                    <div class="sheet_label">体 重:</div>
                    <div class="sheet_value">55kg</div>
                </div>
                <div class="sheet_text">
                    <div class="sheet_label" style="word-spacing: 5.9531px">B 超结果:</div>
                    <div id="bscan" class="sheet_value mark">单胎正常</div>
                </div>
                <div class="sheet_text">
                    <div class="sheet_label" style="word-spacing: 5.9531px">本次妊娠:</div>
                    <div id="gestation" class="sheet_value">自然受孕
                    </div>
                </div>
                <div class="sheet_text">
                    <div class="sheet_label">孕妇一年内是否有过异体输血:</div>
                    <div id="allogBloodTrans" class="sheet_value"> 否</div>
                </div>
                <div class="sheet_text">
                    <div class="sheet_label">孕妇是否做过移植手术:</div>
                    <div id="organTrans" class="sheet_value"> 否</div>
                </div>
                <div class="sheet_text">
                    <div class="sheet_label">孕妇四周内是否做过免疫治疗:</div>
                    <div id="immunotherapy" class="sheet_value"> 否</div>
                </div>
                <div class="sheet_text">
                    <div class="sheet_label">孕妇是否做过干细胞治疗:</div>
                    <div id="apsc" class="sheet_value"> 否</div>
                </div>
                <div class="sheet_text" id="ivfContent">
                    <div class="sheet_label">IVF(试管婴儿):</div>
                    <div id="ivf" class="sheet_value">否</div>
                </div>
                <div style="margin:0 auto; overflow:hidden; display: inline-block;">
                    <div class="sheet_text" style="float: left; width: 100%">
                        <div id="maleKarDetContent" class="sheet_label">男方核型检测：</div>
                        <div id="maleKarDet" class="sheet_value">正常</div>
                    </div>
                    <div class="sheet_text" style="float: left; width: 100%">
                        <div id="femaleKarDetContent" class="sheet_label">女方核型检测：</div>
                        <div id="femaleKarDet" class="sheet_value">正常</div>
                    </div>
                </div>
                <div style="padding-bottom: 7px">
                    <div id="downModelContent" class="sheet_text">
                        <div class="sheet_label">唐筛模式:</div>
                        <div id="downModel" class="sheet_value">未做</div>
                    </div>
                </div>
            </div>
            <div id="sheetOptionContent" class="sheet_optional_content round">
                <div style="padding-top: 7px; padding-bottom: 7px">
                    <div class="sheet_text">
                        <div class="sheet_label">家庭地址:</div>
                        <div id="areaText" class="sheet_value" style="width: 70%;"></div>
                        <script>
                            // $("#areaText").text(genAreaText('', '', ''));
                        </script>
                    </div>
                    <div id="hysContent" class="sheet_text" style="margin:0 auto; overflow:hidden;">
                        <div class="sheet_label" style="float: left">婚育史:</div>
                        <div id="hysGes" class="sheet_value" style="float: left">孕1次</div>
                        <div id="hysLab" class="sheet_value" style="float: left">产0次</div>
                        <div id="hysMis" class="sheet_value" style="float: left">自然流产0次</div>
                    </div>
                    <div class="sheet_text">
                        <div class="sheet_label">病历号码:</div>
                        <div class="sheet_value" style="width: 70%;"></div>
                    </div>
                    <div class="sheet_text">
                        <div class="sheet_label">家族史:</div>
                        <div class="sheet_value" style="width: 70%;"></div>
                    </div>
                    <div class="sheet_text">
                        <div class="sheet_label">临床诊断:</div>
                        <div class="sheet_value" style="width: 70%;"></div>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <div id="operation_box" style="position:block; bottom:0; height:50px;width:100%;">
        <div onclick="operation()" style="cursor:pointer;bottom:10px;margin-left:auto;margin-right:auto;font-size:16px;height:40px;width:120px;color:#ffffff;background:#e66265;border-radius:10px;text-align:center;"><span style="display:inline-block;margin:10px auto;">采样</span></div>
    </div>
    <!-- 遮罩层 -->
    <div id="fade" class="black_overlay"></div>
    <!-- 提示框 -->
    <div id="tipDia" class="tips">
        <p id="tipmsg" class="tips-msg"></p>
        <div class="tips-line"></div>
        <p class="tips-close" onclick="closeTips();">知道了</p>
    </div>
</body>
</html>